<template>
  <page-header-wrapper :title="false">
    <a-card title="顾问主动隐藏的业务">
      <s-table
        bordered
        ref="table"
        size="middle"
        :columns="businessColumns"
        :data="businessData"
      >
        <div slot="title">
          <a-alert type="info" message="小项、发票、尾款等无效业务!!!!"></a-alert>
        </div>
        <template slot="action" slot-scope="text,record">
          <a-button size="small" type="primary" @click="toDetail(record.cb_id)">详情</a-button>
        </template>
      </s-table>
    </a-card>
  </page-header-wrapper>
</template>

<script>
  import { STable } from '@/components'
  import businessColumns from '@/columns/business'
  import { getList } from '@/api/business'
  export default {
    components: {
      STable
    },
    name: 'HiddenBusiness',
    data () {
      return {
        queryParam: {},
        businessColumns: businessColumns.hidden_business,
        businessData: parameters => {
          return getList(Object.assign(parameters, this.queryParam)).then(res => {
            return res.result
          })
        }
      }
    },
    created () {
      this.queryParam['filter[is_hide]'] = '1'
    },
    methods: {
      toDetail (id) {
        this.$router.push({ name: 'BusinessDetail', params: { id } })
      }
    }
  }
</script>

<style scoped>

</style>
